package handler

import (
	"ai-cli/request"
	"ai-cli/utils"
	"fmt"
)

func AiCmd(text string) {
	chat, err := request.CallQwenChat(text)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(chat)
	fmt.Print("回车或输入y执行,输入任意值取消\t")
	//获取用户输入
	isYn := "y"
	fmt.Scanln(&isYn)
	if isYn == "y" {
		utils.Execs(chat)
	}
}
